package com.freewater.javabase.demo.designpattern.command2.undowithstatus.command;

import com.freewater.javabase.demo.designpattern.command2.undowithstatus.receiver.Light;

/**
 * Created by FreeWater on 2017/4/4.
 */
public class LightOffCommand implements Command {

	private Light light;

	public LightOffCommand(Light light){
		this.light = light;
	};

	@Override
	public void execute() {
		this.light.off();
	}

	@Override
	public void undo() {
		this.light.on();
	}
}
